import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import User from '../views/User'
import UserInterface from '../views/user/UserInterface'
import UserApply from '../views/user/UserApply'
import UserProgress from '../views/user/UserProgress'
import UserPaper from '../views/user/UserPaper'
import UserPunish from '../views/user/UserPunish'
import Auditor from '../views/Auditor'
import AuditorInterface from "../views/auditor/AuditorInterface";
import AuditorFirst from "../views/auditor/AuditorFirst";
import AuditorReview from "../views/auditor/AuditorReview";
import AuditorFinal from "../views/auditor/AuditorFinal";
import HealthSup from '../views/HealthSup'
import HealthSupInterface from "../views/healthSup/HealthSupInterface";
import HealthSupApply from "../views/healthSup/HealthSupApply";
import HealthSupSearch from "../views/healthSup/HealthSupSearch";
import HealthSupPunish from "../views/healthSup/HealthSupPunish";
import HealthSupPunishSearch from "../views/healthSup/HealthSupPunishSearch";
import HealthSupApplySubmit from "../views/healthSup/HealthSupApplySubmit";

import Home from '../views/Home';






Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/user',
    name: 'User',
    // component引入进来的对象
    component: User,
    meta:{requireAuth:true,roles:['corp']},
    //User路由下面的子路由
    children:[
        {
      path: '/user/userinterface',
      name: 'UserInterface',
      component: UserInterface
    },
      {
        path: '/user/userapply',
        name: 'UserApply',
        component: UserApply
      },
      {
        path: '/user/userprogress',
        name: 'UserProgress',
        component: UserProgress
      },

      {
        path: '/user/userpaper',
        name: 'UserPaper',
        component: UserPaper
      },

      {
        path: '/user/userpunish',
        name: 'UserPunish',
        component: UserPunish
      },
    ]
  },
  {
    path: '/auditor',
    name: 'Auditor',
    component: Auditor,
    meta:{requireAuth:true,roles:['审核员']},
    //审核员（auditor）的子路由
    children:[
      {
        path: '/auditor/auditorinterface',
        name: 'AuditorInterface',
        component: AuditorInterface
      },
      {
        path: '/auditor/auditorfirst',
        name: 'AuditorFirst',
        component: AuditorFirst
      },
      {
        path: '/auditor/auditorreview',
        name: 'AuditorReview',
        component: AuditorReview
      },
      {
        path: '/auditor/auditorfinal',
        name: 'AuditorFinal',
        component: AuditorFinal
      },
    ]


  },
  {
    path: '/healthsup',
    name: 'HealthSup',
    component: HealthSup,
    meta:{requireAuth:true,roles:['监督员']},
    //监督员（healthsup）的子路由
    children:[
      {
        path: '/healthSup/healthsupinterface',
        name: 'HealthSupInterface',
        component: HealthSupInterface
      },
      {
        path: '/healthSup/healthsupapply',
        name: 'HealthSupApply',
        component: HealthSupApply
      },
      {
        path: '/healthSup/healthsupsearch',
        name: 'HealthSupSearch',
        component: HealthSupSearch
      },
      {
        path: '/healthSup/healthsuppunish',
        name: 'HealthSupPunish',
        component: HealthSupPunish
      },
      {
        path: '/healthSup/healthsuppunishsearch',
        name: 'HealthSupPunishSearch',
        component: HealthSupPunishSearch
      },
      {
        path: '/healthSup/healthsupapplysubmit',
        name: 'HealthSupApplySubmit',
        component: HealthSupApplySubmit
      },
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
